﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Dynamic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ThapCam.Provider;
using ThapCam.System;

public partial class VideoDetail : PageBase
{
    protected DataTable listHot;
    protected Dictionary<string, object> subject;

    protected override void createModuleLogic(ThapCamApplication application)
    {
        pageLogic = new DetailLogic(application);
        dynamic obj = ThapCamLogic.properties["HCDefault"] as ExpandoObject;
        this.group = obj.group;
        this.pageTitle = obj.title;
        this.pageDescription = obj.description;
        this.pageKeyword = obj.keyword;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["ID"] != null)
            {
                int subID = int.Parse(Request.QueryString["ID"].ToString().Trim());

                listHot = (pageLogic as DetailLogic).getListHot(20);
                subject = (pageLogic as DetailLogic).getDetailSubject(subID);
                if (subject != null && subject.Count != 0)
                    this.pageTitle = subject["Title"].ToString().Trim();   
            }
        }
    }
}